package com.javaee.service.admin.impl;


import com.javaee.entity.Board;
import com.javaee.mapper.admin.BoardMapper;
import com.javaee.service.admin.BoardService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static java.time.LocalDateTime.now;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author mo
 * @since 2024-11-27
 */
@Service
public class BoardServiceImpl implements BoardService {
@Autowired
    private BoardMapper boardMapper;

    @Override
    public boolean insertBoard(Board board) {
       return boardMapper.insertBoard(board);
    }



    @Override
    public Boolean deleteBoard(Integer id) {
        return boardMapper.deleteBoard(id);
    }

    @Override
    public Board getBoardById(Integer id) {
        return boardMapper.getBoardById(id);
    }

    @Override
    public Boolean updateBoard(Board board) {
       return boardMapper.updateBoard(board);
    }

    @Override
    public List<Board> searchBoard(String keyword, int pageNum, int pageSize) {
        return boardMapper.searchBoard(keyword,pageNum,pageSize);
    }

    @Override
    public int selectCount() {
        return boardMapper.selectCount();
    }
}
